<html>
<head><meta charset="utf-8"><title>how to add a cfg attribute · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20add.20a.20cfg.20attribute.html">how to add a cfg attribute</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="221244091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20add%20a%20cfg%20attribute/near/221244091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> devsnek <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20add.20a.20cfg.20attribute.html#221244091">(Dec 30 2020 at 20:31)</a>:</h4>
<p>I'd like to experiment with a <code>cfg(wasm)</code> which is true for <code>target_arch = "wasm64"</code> or <code>target_arch = "wasm32"</code>, to match the <code>__wasm__</code> define that clang has.</p>



<a name="221244203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20add%20a%20cfg%20attribute/near/221244203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20add.20a.20cfg.20attribute.html#221244203">(Dec 30 2020 at 20:32)</a>:</h4>
<p><span class="user-mention silent" data-user-id="219805">devsnek</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/how.20to.20add.20a.20cfg.20attribute/near/221244091">said</a>:</p>
<blockquote>
<p>I'd like to experiment with a <code>cfg(wasm)</code> which is true for <code>target_arch = "wasm64"</code> or <code>target_arch = "wasm32"</code>, to match the <code>__wasm__</code> define that clang has.</p>
</blockquote>
<p><code>rg sym::windows compiler/</code> shows me <a href="https://github.com/rust-lang/rust/blob/507bff92fadf1f25a830da5065a5a87113345163/compiler/rustc_session/src/config.rs#L816">https://github.com/rust-lang/rust/blob/507bff92fadf1f25a830da5065a5a87113345163/compiler/rustc_session/src/config.rs#L816</a></p>



<a name="221244414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20add%20a%20cfg%20attribute/near/221244414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> devsnek <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20add.20a.20cfg.20attribute.html#221244414">(Dec 30 2020 at 20:35)</a>:</h4>
<p>thank you <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="221247549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20add%20a%20cfg%20attribute/near/221247549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20add.20a.20cfg.20attribute.html#221247549">(Dec 30 2020 at 21:21)</a>:</h4>
<p>When in doubt, ripgrep!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>